<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<ui:composition template="/template/masterLayout.xhtml">
	<ui:define name="content">
		<h:form>
			<h:panelGrid columns="3">
				<h:commandLink action="/historical/search.xhtml"
					value="#{msgs.histMenu1}" />
				<h:commandLink action="/historical/hist_data.xhtml"
					value="#{msgs.histMenu2}" />
				<h:commandLink action="/historical/hist_data.xhtml"
					value="#{msgs.histMenu3}" />
			</h:panelGrid>
		</h:form>

		<div id="content">

			<h:form>
				<h:panelGrid columns="3">
				#{msgs.histGenObject}
				<rich:select value="#{pred.currentPredObjId}">
						<f:selectItems value="#{pred.predictableObj}" var="w"
							itemLabel="#{w.objName}" itemValue="#{w.objId}" />
					</rich:select>
					<h:commandButton value="Sprawdź" action="#{pred.findSpecObj}" />
				</h:panelGrid>

				<rich:extendedDataTable id="table" value="#{pred.stockObj}"
					var="cap" rows="15" frozenColumns="1" selectionMode="single"
					selection="#{pred.selection}">
					<f:facet name="noData">
                	Nie znaleziono obiektu
            		</f:facet>
					<rich:column>
						<f:facet name="header">Ticker</f:facet>
						<h:outputText value="#{cap.stockObjTicker}" />
					</rich:column>
					<rich:column filterValue="#{stockFilteringBean.nameFilter}"
						filterExpression="#{fn:containsIgnoreCase(cap.stockObjName,stockFilteringBean.nameFilter)}">>
						<f:facet name="header">
							<h:panelGroup>
								<h:outputText value="NAME " />
								<h:inputText value="#{stockFilteringBean.nameFilter}">
									<a4j:ajax event="blur" render="table" execute="@this" />
								</h:inputText>
							</h:panelGroup>
						</f:facet>
						<h:outputText value="#{cap.stockObjName}" />
					</rich:column>
					<rich:column>
						<f:facet name="header">Country</f:facet>
						<h:outputText value="#{cap.stockObjCountry}" />
					</rich:column>
				</rich:extendedDataTable>
				<rich:dataScroller for="table" maxPages="5">
					<f:facet name="first">
						<h:outputText value="First" />
					</f:facet>
					<f:facet name="last">
						<h:outputText value="Last" />
					</f:facet>
				</rich:dataScroller>
				<h:commandButton value="Wybierz" action="#{pred.setSpecObj}" />
			</h:form>
		</div>
	</ui:define>
</ui:composition>
</html>